import {SystemUserDataRow} from './system-user.ts'
import {CameraStatus} from './camera.ts'

export interface RiskStatisticData {
  heightRisk: number
  sum: number
  midRisk: number
  normalRisk: number
}

export enum RiskType {
  HighAndMiddle = 0,
  Middle = 1,
  High = 2,
  None = 3,
  Detail = 4,
}

export enum RiskActionStatus {
  Unhandled = 0,
  Handled = 1,
}

export interface ElderByRiskListData {
  filter(arg0: (row: { actionStatus: FinalRiskType }) => boolean): ElderByRiskListDataRow[]
  length: string
  total: number
  data: ElderByRiskListDataRow[]
}

export interface ElderByRiskListDataRow {
  actionStatus: FinalRiskType
  lastAction(lastAction: any): unknown
  location: any
  ownerName: string
  ownerId: number
  buildingId: number
  roomId: number
  roomName: string
  createTime: string
  userId: number
  managers: SystemUserDataRow[]
  dict_label: string
  finalActCn: string
  nickName: string
  cameraStatus: CameraStatus
  finalRiskType: FinalRiskType
  createBy: string
  updateBy: string
  updateTime: string
  remark: string
  userName: string
  phonenumber: string
  buildingName: string
  floorId: number
  floorName: string
  finalActEn?: string
  actionId?: number
  dealStatus?: number
  startTime?: string
  endTime?: string
  suid: string[]
  videos?: VideosType[]
}
export interface VideosType {
  createBy: string
  createTime: string
  updateBy: string
  updateTime: string
  remark: string
  id: number
  userId: string
  suid: string
  t0: string
  info: string
  src: string //暂无 未确定回放视频地址
}
export interface SearchElderByRiskBody {
  buildingId?: number
  floorId?: number
  key?: string
  status?: RiskActionStatus
  roomId?: string
  roomName?: string
  riskType?: RiskType
}

export enum FinalRiskType {
  // High = 'biz_risk_height',
  // RiskMid = 'biz_risk_mid',
  // RiskNone = 'biz_risk_normal',
  High = 'danger',
  RiskMid = 'warning',
  RiskNone = 'normal',
}

export interface SearchElderByRiskDataRow {
  roomId: number
  floorName: string
  roomName: string
  buildingId: number
  buildingName: string
  userId: number
  userName: string
  nickName: string
  finalRiskType: FinalRiskType
  floorId: number
}

export interface SearchElderByRiskData {
  total: number
  rows: SearchElderByRiskDataRow[]
}

export interface SearchRiskTypeParams {
  riskType?: RiskType | null
  roleIds?: number
  pageNum?: number
  pageSize?: number
  search?: String | null
}
